package com.leaves.leetcode.array.t1995_CountSpecialQuadruplets;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.leaves.leetcode.UnitTesting;

public class T1995Main extends UnitTesting<int[], Integer> {

    Solution solution = new Solution();

    @Override
    protected void generateTestData() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            testDataList.add(createTestData(
                    objectMapper.readValue("[1,2,3,6]", new TypeReference<int[]>() {}),
                    1
            ));
            testDataList.add(createTestData(
                    objectMapper.readValue("[3,3,6,4,5]", new TypeReference<int[]>() {}),
                    0
            ));
            testDataList.add(createTestData(
                    objectMapper.readValue("[1,1,1,3,5]", new TypeReference<int[]>() {}),
                    4
            ));

        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public Integer run(int[] inputData) {
        return solution.countQuadruplets(inputData);
    }
}
